<?php
//initialisation des variables
$id = 1;
//on récupère les informations
if (isset($_GET['id'])) {
    $id = htmlentities($_GET['id'], ENT_QUOTES);
    require_once 'include/config.php';
    //Gestion des fiches poissons
    $sql = 'SELECT m.`titre`, m.`description`,m.`img`,m.`imgWH`,`marque`.`nom` FROM `materiel` m INNER JOIN `marque` ON `m`.`idmarque`=`marque`.`idmarque`  WHERE `idmateriel`= ' . $id;
    $result = mysql_query($sql);
    $data = mysql_fetch_array($result);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//FR" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
    <head>
        <title><?php echo $data['titre']; ?> en vente chez l'Aquarium Anzin</title>
        <meta charset="utf-8" />
        <meta name="description" content="Découvrez ici la fiche matériel détaillée de <?php echo $data['titre']; ?>. Venez découvrir l'ensemble des caractéristiques de ce matériel d'aquariophilie." />
        <meta name="keywords" content="matériel, aquariophilie, <?php echo $data['titre']; ?>,marque,eau douce, eau mer, eau froide, fiche, aquarium, anzin" />
        <link rel="stylesheet" href="css/style.css" />
        <link rel="icon" href="images/favicon.ico" type="image/x-icon" />
        <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />             
        <!--[if lt IE 8]>
              <div style=' clear: both; text-align:center; position: relative;'>
                <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
                  <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
               </a>
             </div>
            <![endif]-->
        <!--[if lt IE 9]>
                        <script src="js/html5.js"></script>
                        <link rel="stylesheet" href="css/ie.css">
                <![endif]-->
    </head>
    <body id="page1">
        <!--==============================header=================================-->
        <?php
        require_once 'include/menu.php';
        ?>
        <!--==============================content====================================-->
        <section id="content">
            <div class="container_24">
                <div class="wrapper border-vert2">
                    <div class="grid_16" itemscope itemtype = "http://schema.org/CreativeWork">
                        <div class="wrapper">
                            <h1 itemprop = "name"><?php echo htmlspecialchars(stripcslashes($data['titre'])); ?></h1>
                        </div>
                        <div class="wrapper">
                            <div class="grid_16">
                                <em>Marque : </em><?php echo $data['nom']; ?><br />                                                                                                
                            </div>                            
                        </div>
                        <div class="wrapper" itemprop = "description">
                            <em>Description : </em>
                            <?php
                            //gérer les puces avec tinymce dans la charte graphique qui désactive les puces.
                            $patterns = '/<li>/';
                            if (preg_match('/<ul>/', $data['description'])) {
                                $replacements = '<li style="list-style: inside disc;margin-left:30px;">';
                            } else {
                                $replacements = '<li style="list-style: inside decimal;margin-left:30px;">';
                            }
                            echo stripslashes(preg_replace($patterns, $replacements, $data['description']));
                            ?>
                        </div>
                    </div>

                    <div class="grid_7 prefix_1" style="text-align: center;">
                        <?php
                        if (!empty($data['img'])) {
                            echo '<div class="pro_image_right"><span class="pro_image_style2"><img src="', $data['img'], '" alt="', $data['titre'], '" ', $data['imgWH'], '  itemprop = "image" /></span></div>';
                        }
                        ?>
                    </div>
                </div>                
            </div>
        </section>
        <?php
        require_once 'include/footer.php';
        ?>
    </body>
</html>